#!/usr/bin/python
import os
import sys

def runModule(modName):
    print 'Running Test ' + modName
    modInst         = __import__(modName)
    objInst         = getattr(modInst, modName)()
    objInst.run()
    return modInst

if len(sys.argv) == 2:
    runModule(sys.argv [1])
else:
    files   = os.listdir('.')
    modList = {}
    for file in files:
        if os.path.isfile(file) and file[len(file)-3:len(file)] == '.py' and file[0:len('test')] == 'test':
            modName             = file[0:len(file)-3]
            modList [modName]   = runModule(modName)
            
